<template>
  <el-button size="small" type="danger" @click="showRoleModal(true)"
    >分配角色</el-button
  >
  <jm-drawer
    v-if="roleVisible"
    v-model="roleVisible"
    @confirm="onConfirm"
    @close="showRoleModal(false)"
    title="分配角色"
    size="50%"
  >
    <jm-table
      @change="handlerCheckbox"
      showCheckbox
      row-key="id"
      :isCustomWidth="false"
      :hasRefresh="false"
      ref="tableRef"
      max-height="78vh"
      :columns="USER_ADD_ROLE_COLUMNS"
      :apiParams="{}"
      url="/dataApi/sys/getRoleList"
    >
    </jm-table>
  </jm-drawer>
</template>
<script setup>
import { inject } from 'vue'
import { USER_ADD_ROLE_COLUMNS } from '../static'

const { roleVisible, showRoleModal, handlerCheckbox, onConfirm } =
  inject('modules').addRoleStore
</script>
<style lang="scss" scoped></style>
